package com.yc.cloud.openai.portal.factory;

import java.util.EnumMap;
import java.util.Map;

import org.springframework.stereotype.Component;

import com.yc.cloud.openai.portal.dao.TextToVideoClient;
import com.yc.cloud.openai.portal.enums.TextToVideoProvider;

@Component
public class TextToVideoClientFactory {

    private final Map<TextToVideoProvider, TextToVideoClient> clientMap = new EnumMap<>(TextToVideoProvider.class);

    public TextToVideoClientFactory(Map<String, TextToVideoClient> clientBeans) {
        // 使用枚举的 value 作为键来初始化 Map
        clientBeans.forEach((name, client) -> clientMap.put(TextToVideoProvider.valueOf(name), client));
    }

    public Map<TextToVideoProvider, TextToVideoClient> getClientMap() {
        return clientMap;
    }
}
